package IO流.转换流;

import java.io.*;
import java.nio.charset.Charset;

public class 指定字符进行写入 {
    public static void main(String[] args) throws IOException {
//        OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream("F\\b.txt"),"GBK");
//        osw.write("我是GDK编码");
//        osw.close();

        FileWriter fw=new FileWriter("b.txt", Charset.forName("GBK"));
        fw.write("我是GKD编码");
        fw.close();


    }
}
